package com.jingbit.ai;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.jingbit.ai.baidu.map.BaiduMap;
import com.jingbit.ai.base.BaseApp;

import xcrash.XCrash;

public class AIApp extends BaseApp {
    public static final String TAG = "jingbit";
    public static final String BT_PWD = "1234";
    public static final String BT_ADDR = "98:DA:20:04:EB:B6";
    public static final String VIDEO_RTMP_URL = "rtmp://192.168.43.136:1935/video/jingbit";
    public static final String AUDIO_RTMP_URL = "rtmp://192.168.43.136:1935/audio/jingbit";
    public static final String SOCKET_URL = "192.168.43.136";//192.168.43.136
    public static final int SOCKET_PORT = 19999;


    @Override
    public void onCreate() {
        super.onCreate();
        XCrash.init(this);
        try {
            initIflytek();
            BaiduMap.initBDMap(this);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
//        InFileStream.setContext(this);
    }

    private void initIflytek() {
        // 打印日志
        registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
            @Override
            public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {

            }

            @Override
            public void onActivityStarted(@NonNull Activity activity) {

            }

            @Override
            public void onActivityResumed(@NonNull Activity activity) {
                Log.d("Activity Resumed ----- ", activity.getClass().getName());
            }

            @Override
            public void onActivityPaused(@NonNull Activity activity) {

            }

            @Override
            public void onActivityStopped(@NonNull Activity activity) {

            }

            @Override
            public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {

            }

            @Override
            public void onActivityDestroyed(@NonNull Activity activity) {

            }
        });
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }
}
